package org.ice4apps.talk.dao;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * TalkEnterprise entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "talk_enterprise", catalog = "icetalk")
public class TalkEnterprise implements java.io.Serializable {
    // Fields
    private String                id;
    private Long                  features;
    private Long                  creationdate;
    private Long                  updationdate;
    private Set<TalkOrganization> talkOrganizations = new HashSet<TalkOrganization> (0);
    private Set<PublicNumber>     publicNumbers     = new HashSet<PublicNumber> (0);

    // Constructors
    /** default constructor */
    public TalkEnterprise () {
    }

    /** minimal constructor */
    public TalkEnterprise (String id, Long creationdate) {
        this.id = id;
        this.creationdate = creationdate;
    }

    /** full constructor */
    public TalkEnterprise (String id,
                           Long features,
                           Long creationdate,
                           Long updationdate,
                           Set<TalkOrganization> talkOrganizations,
                           Set<PublicNumber> publicNumbers) {
        this.id = id;
        this.features = features;
        this.creationdate = creationdate;
        this.updationdate = updationdate;
        this.talkOrganizations = talkOrganizations;
        this.publicNumbers = publicNumbers;
    }

    // Property accessors
    @Id
    @Column(name = "id", unique = true, nullable = false, length = 36)
    public String getId () {
        return this.id;
    }

    public void setId (String id) {
        this.id = id;
    }

    @Column(name = "features")
    public Long getFeatures () {
        return this.features;
    }

    public void setFeatures (Long features) {
        this.features = features;
    }

    @Column(name = "creationdate", nullable = false)
    public Long getCreationdate () {
        return this.creationdate;
    }

    public void setCreationdate (Long creationdate) {
        this.creationdate = creationdate;
    }

    @Column(name = "updationdate")
    public Long getUpdationdate () {
        return this.updationdate;
    }

    public void setUpdationdate (Long updationdate) {
        this.updationdate = updationdate;
    }

    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "talkEnterprise")
    public Set<TalkOrganization> getTalkOrganizations () {
        return this.talkOrganizations;
    }

    public void setTalkOrganizations (Set<TalkOrganization> talkOrganizations) {
        this.talkOrganizations = talkOrganizations;
    }

    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "talkEnterprise")
    public Set<PublicNumber> getPublicNumbers () {
        return this.publicNumbers;
    }

    public void setPublicNumbers (Set<PublicNumber> publicNumbers) {
        this.publicNumbers = publicNumbers;
    }
}